/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.anhanguera.tcc.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Diego
 */
@Entity
@Table(name = "tb_notificacao_automatica")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "NotificacaoAutomatica.findAll", query = "SELECT n FROM NotificacaoAutomatica n"),
    @NamedQuery(name = "NotificacaoAutomatica.findByIdNotificacaoAutomatica", query = "SELECT n FROM NotificacaoAutomatica n WHERE n.idNotificacaoAutomatica = :idNotificacaoAutomatica"),
    @NamedQuery(name = "NotificacaoAutomatica.findByQtDias", query = "SELECT n FROM NotificacaoAutomatica n WHERE n.qtDias = :qtDias"),
    @NamedQuery(name = "NotificacaoAutomatica.findByEdEmail", query = "SELECT n FROM NotificacaoAutomatica n WHERE n.edEmail = :edEmail")})
public class NotificacaoAutomatica implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_NOTIFICACAO_AUTOMATICA")
    private Integer idNotificacaoAutomatica;
    @Basic(optional = false)
    @Column(name = "QT_DIAS")
    private int qtDias;
    @Basic(optional = false)
    @Column(name = "ED_EMAIL")
    private String edEmail;
    @JoinColumn(name = "COD_CONTRATO", referencedColumnName = "ID_CONTRATO")
    @ManyToOne(optional = false)
    private Contrato codContrato;

    public NotificacaoAutomatica() {
    }

    public NotificacaoAutomatica(Integer idNotificacaoAutomatica) {
        this.idNotificacaoAutomatica = idNotificacaoAutomatica;
    }

    public NotificacaoAutomatica(Integer idNotificacaoAutomatica, int qtDias, String edEmail) {
        this.idNotificacaoAutomatica = idNotificacaoAutomatica;
        this.qtDias = qtDias;
        this.edEmail = edEmail;
    }

    public Integer getIdNotificacaoAutomatica() {
        return idNotificacaoAutomatica;
    }

    public void setIdNotificacaoAutomatica(Integer idNotificacaoAutomatica) {
        this.idNotificacaoAutomatica = idNotificacaoAutomatica;
    }

    public int getQtDias() {
        return qtDias;
    }

    public void setQtDias(int qtDias) {
        this.qtDias = qtDias;
    }

    public String getEdEmail() {
        return edEmail;
    }

    public void setEdEmail(String edEmail) {
        this.edEmail = edEmail;
    }

    public Contrato getCodContrato() {
        return codContrato;
    }

    public void setCodContrato(Contrato codContrato) {
        this.codContrato = codContrato;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idNotificacaoAutomatica != null ? idNotificacaoAutomatica.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NotificacaoAutomatica)) {
            return false;
        }
        NotificacaoAutomatica other = (NotificacaoAutomatica) object;
        if ((this.idNotificacaoAutomatica == null && other.idNotificacaoAutomatica != null) || (this.idNotificacaoAutomatica != null && !this.idNotificacaoAutomatica.equals(other.idNotificacaoAutomatica))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.anhanguera.tcc.model.NotificacaoAutomatica[ idNotificacaoAutomatica=" + idNotificacaoAutomatica + " ]";
    }

}
